package com.zifuchuan.domain;
/*
现已知工人（Worker）类，属性包含姓名（name）、工龄（year），请编写该类，
提供构造方法和get、set方法。
 */
public class Worker {
    private String name;
    private String year;

    public Worker() {
    }

    public Worker(String name, String year) {
        this.name = name;
        this.year = year;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    @Override
    public String toString() {
        return "Worker{" +
                "name='" + name + '\'' +
                ", year='" + year + '\'' +
                '}';
    }
}
